import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: '/login',
    component: () => import('@/views/login/index'),
  },

  {
    path: '/',
    redirect: "/home",
    component: () => import('@/views/home/index'),

    children:[
      {
        path: '/goods',
        meta:{title:'商品管理'},
        component: () => import('@/views/goods/index'),
      },
      {
        path: '/supplier',
        meta:{title:'供应商管理'},
        component: () => import('@/views/supplier/index'),
      },
      {
        path: '/member',
        meta:{title:'会员管理'},
        component: () => import('@/views/member/index'),
      },
      {
        path: '/staff',
        meta:{title:'员工管理'},
        component: () => import('@/views/staff'),
      },
      {
        path: '/home',
        component: () => import('@/views/zhuye/index'),
      }
    ]
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
